package com.cooldatasoft.domain.serviceImpl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.cooldatasoft.domain.dao.EventDao;
import com.cooldatasoft.domain.model.Event;
import com.cooldatasoft.domain.model.User;
import com.cooldatasoft.domain.service.EventService;

@Service("eventService")
public class EventServiceImpl implements EventService {

	@Autowired
	private EventDao eventDao;
	
	@Override
	public Long insertEvent(Event myEvent) {
		return eventDao.insert(myEvent);
	}

	@Override
	public void updateEvent(Event myEvent) {
		eventDao.update(myEvent);		
	}

	@Override
	public void deleteEvent(Long myEventId) {
		eventDao.delete(myEventId);		
	}

	@Override
	public List<Event> getAllEvent() {
		return eventDao.getAll();
	}

	@Override
	public Event getById(Long id) {
		return eventDao.getById(id);
	}

	@Override
	public List<Event> getAllEventOfUser(User user) {
		return eventDao.getAllEventOfUser(user);
	}
}
